<html>
<head><meta charset="utf-8"><title>Accessing a field in a tuple · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html">Accessing a field in a tuple</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216979167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/216979167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#216979167">(Nov 17 2020 at 09:03)</a>:</h4>
<p>If I have a <code>Ty::Tuple</code> the only way I can see accessing a field is to call <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyS.html#method.tuple_fields"><code>tuple_fields</code></a> and then do <code>nth(index)</code>. </p>
<p>By understanding is that since this is a DoubleEndedIterator accessing a specific field would cost <code>O(n)</code></p>
<p>I'm wondering if there is a method to do this more effeciently? (possibly O(1)/random access)</p>



<a name="217003243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003243">(Nov 17 2020 at 13:42)</a>:</h4>
<p>hmm this is an interesting question (and maybe more for <a class="stream" data-stream-id="219381" href="/#narrow/stream/219381-t-libs">#t-libs</a> than <a class="stream" data-stream-id="131828" href="/#narrow/stream/131828-t-compiler">#t-compiler</a>)</p>



<a name="217003264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003264">(Nov 17 2020 at 13:42)</a>:</h4>
<p>if you look at <a href="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/sty.rs.html#2180">https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/sty.rs.html#2180</a> it's calling <code>.iter().map()</code> on a <code>Vec</code></p>



<a name="217003351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003351">(Nov 17 2020 at 13:43)</a>:</h4>
<p>now <code>Vec.iter()</code> overrides <code>.nth()</code> to be more efficient, since it has random access to the elements: <a href="https://doc.rust-lang.org/src/core/slice/mod.rs.html#3785">https://doc.rust-lang.org/src/core/slice/mod.rs.html#3785</a></p>



<a name="217003440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003440">(Nov 17 2020 at 13:44)</a>:</h4>
<p>however <code>.map()</code> doesn't know anything about the internal iterator, so it doesn't override <code>.nth()</code>, even for <code>DoubleEndedIterator</code>s: <a href="https://doc.rust-lang.org/src/core/iter/adapters/mod.rs.html#836">https://doc.rust-lang.org/src/core/iter/adapters/mod.rs.html#836</a></p>



<a name="217003474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003474">(Nov 17 2020 at 13:44)</a>:</h4>
<p>I wonder if there's a way to 'forward' that knowledge from Iter to Map</p>



<a name="217003610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003610">(Nov 17 2020 at 13:45)</a>:</h4>
<p>in the short term, you can do this by calling nth() before calling map:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">        </span><span class="k">match</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">kind</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">Tuple</span><span class="p">(</span><span class="n">substs</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">substs</span><span class="p">.</span><span class="n">iter</span><span class="p">().</span><span class="n">nth</span><span class="p">(</span><span class="n">index</span><span class="p">).</span><span class="n">map</span><span class="p">(</span><span class="o">|</span><span class="n">field</span><span class="o">|</span><span class="w"> </span><span class="n">field</span><span class="p">.</span><span class="n">expect_ty</span><span class="p">()),</span><span class="w"></span>
<span class="w">            </span><span class="n">_</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">unreachable</span><span class="o">!</span><span class="p">(),</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="217003707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003707">(Nov 17 2020 at 13:46)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> could you move this to <a class="stream" data-stream-id="219381" href="/#narrow/stream/219381-t-libs">#t-libs</a> ?</p>



<a name="217003839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003839">(Nov 17 2020 at 13:47)</a>:</h4>
<p>I can, in a few minutes - we have TrustedRandomAccess or something like that for this purpose</p>



<a name="217003849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217003849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217003849">(Nov 17 2020 at 13:47)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="182449" href="/#narrow/stream/182449-t-compiler.2Fhelp/topic/Accessing.20a.20field.20in.20a.20tuple">#t-compiler/help &gt; Accessing a field in a tuple</a> by <span class="user-mention silent" data-user-id="116107">davidtwco</span></p>



<a name="217004323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004323">(Nov 17 2020 at 13:52)</a>:</h4>
<p>ok - so maybe <code>Map</code> should be taking greater advantage of <code>TrustedRandomAccess</code>?</p>



<a name="217004638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004638">(Nov 17 2020 at 13:54)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I think the place to modify is <a href="https://doc.rust-lang.org/src/core/iter/adapters/mod.rs.html#932">https://doc.rust-lang.org/src/core/iter/adapters/mod.rs.html#932</a>, are you interested in a PR?</p>
<p>on nightly I do see <code>SourceIter</code> for this but I'm not sure if it's related or not</p>



<a name="217004646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004646">(Nov 17 2020 at 13:55)</a>:</h4>
<p>but in any case, map cannot do this</p>



<a name="217004672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004672">(Nov 17 2020 at 13:55)</a>:</h4>
<p>map().nth() means to iterate N places, and the closure could have side effects</p>



<a name="217004784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004784">(Nov 17 2020 at 13:56)</a>:</h4>
<p>ahh, because it's FnMut, not Fn</p>



<a name="217004795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004795">(Nov 17 2020 at 13:56)</a>:</h4>
<p>that's unfortunate</p>



<a name="217004806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004806">(Nov 17 2020 at 13:56)</a>:</h4>
<p>Well, no, that's not important</p>



<a name="217004847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217004847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217004847">(Nov 17 2020 at 13:56)</a>:</h4>
<p>we would expect N println!s, if the closure was <code>|x| { println!{"{:?}", x); x }</code></p>



<a name="217005319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217005319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217005319">(Nov 17 2020 at 14:01)</a>:</h4>
<p>ah hmm I see, it's true here too - there could be a panic in <code>expect_ty</code></p>



<a name="217005455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217005455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217005455">(Nov 17 2020 at 14:02)</a>:</h4>
<p>maybe the fix should be in rustc, have a <code>nth_tuple_field()</code> that's more efficient than O(n)</p>



<a name="217047592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217047592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217047592">(Nov 17 2020 at 19:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple/near/217005455">said</a>:</p>
<blockquote>
<p>maybe the fix should be in rustc, have a <code>nth_tuple_field()</code> that's more efficient than O(n)</p>
</blockquote>
<p>Yeah that's what I was thinking, maybe move this back to <code>t-compiler</code> or <code>t-compiler/help</code></p>



<a name="217047827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217047827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217047827">(Nov 17 2020 at 19:07)</a>:</h4>
<p>how would that be better than tuple_fields().nth(5).whatever ?</p>



<a name="217048711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217048711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217048711">(Nov 17 2020 at 19:15)</a>:</h4>
<p>I was picturing it more like in rustic we know it isn't necessarily is a side effect to just do <code>substs.iter().nth(index).map(|field| field.expect_ty())</code>. So basically what <span class="user-mention" data-user-id="232545">@Joshua Nelson</span>  suggested</p>



<a name="217048938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217048938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217048938">(Nov 17 2020 at 19:16)</a>:</h4>
<p>And <code>nth()</code> here is on RandomAccess Iterator so it's quicker</p>



<a name="217049378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217049378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217049378">(Nov 17 2020 at 19:20)</a>:</h4>
<p>Shouldn't the adapters generally override the default traitethod impl by calling their inner iterator's impl of the method?</p>



<a name="217049671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217049671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217049671">(Nov 17 2020 at 19:22)</a>:</h4>
<p>Yes, but as mentioned, <code>map(f).nth(n)</code> doesn't call the inner <code>nth</code> because <code>f</code> might have side effects on all of the items</p>



<a name="217049788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217049788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217049788">(Nov 17 2020 at 19:23)</a>:</h4>
<p>see also <a href="https://github.com/rust-lang/rust/issues/73069">https://github.com/rust-lang/rust/issues/73069</a></p>



<a name="217050061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217050061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217050061">(Nov 17 2020 at 19:26)</a>:</h4>
<p>and this one had a T-libs discussion: <a href="https://github.com/rust-lang/rust/pull/28125">https://github.com/rust-lang/rust/pull/28125</a></p>



<a name="217050267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217050267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217050267">(Nov 17 2020 at 19:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="138448">cuviper</span> <a href="#narrow/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple/near/217049671">said</a>:</p>
<blockquote>
<p>Yes, but as mentioned, <code>map(f).nth(n)</code> doesn't call the inner <code>nth</code> because <code>f</code> might have side effects on all of the items</p>
</blockquote>
<p>I flipped the <code>nth()</code> and <code>map</code> around</p>



<a name="217050467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217050467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217050467">(Nov 17 2020 at 19:29)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> yes, <code>map</code> afterward is fine, that's <code>Option::map</code>. I was responding to <span class="user-mention" data-user-id="224471">@Lokathor</span>'s question about adapters</p>



<a name="217050588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217050588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217050588">(Nov 17 2020 at 19:30)</a>:</h4>
<p>Ah, sorry</p>



<a name="217050698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Accessing%20a%20field%20in%20a%20tuple/near/217050698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Accessing.20a.20field.20in.20a.20tuple.html#217050698">(Nov 17 2020 at 19:31)</a>:</h4>
<p>Oops, yeah, order matters big in this one</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>